import JSEncrypt from 'jsencrypt'
// const privateKey = require('./privateKey')
import privateKey from './privateKey'
export default {
  encrypePwd: (pwd: string | undefined) => {
    if (!pwd) pwd = ''
    const encryptor = new JSEncrypt()
    encryptor.setPublicKey(privateKey) // private key for JWE and JWE2 描述的意味是要加密
    let encrypedPwd = encryptor.encrypt(pwd)
    if (encrypedPwd) return encrypedPwd
    else return '' // return encrypted password as string 加密密码并返回加密的字节数组或字符串
  } // 加密函数, msg为要加密的内容，passphrase为
}
